package com.huajin.gateway.flow.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController()

public class CaptureActionController {
    @Autowired
    private StringRedisTemplate redisTemplate;

    @PostMapping("/start")
    public Long start(@RequestBody String action) {
        return redisTemplate.opsForList().leftPush("capture", action);
    }

    @PostMapping("/stop")
    public Long stop(@RequestBody String action) {
        return redisTemplate.opsForList().leftPush("capture", action);
    }
}
